<?php

if(!defined("INDEX"))
    die;

if(!check_get('id') && !check_get('name')) {
    header('Location: /');
    exit;
}

// ----------------------------------------------------------------------------

$artist = null;

try {
    if(isset($_GET['id']))
        $artist = Artist::getById($_GET['id']);
    elseif(isset($_GET['name']))
        $artist = Artist::getByName($_GET['name']);

} catch (Exception $e) {

}

if(!($artist instanceof Artist))
    throw new Exception(_('Sorry, no such artist.'));

$smarty->assign('artist', $artist);

$smarty->assign('tags', $artist->getTags(7));
$smarty->assign('labels', $artist->getLabels());
$smarty->assign('members', $artist->getMembers());
$smarty->assign('releases', $artist->getReleases());
$smarty->assign('comments', $artist->getComments());

$smarty->assign('watched', $artist->isWatchedByUser($user->id));